<admintpl file="header" />
<style>
.well{font-size:12px;}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{
padding:0px;
}
.table>thead>tr>th{border-bottom:none;}
.thepop-msg{
position: fixed;
display:none;
top: 60px;
padding-top: 10px;
padding-bottom:50px;
width: 60%;
height: auto;
background: rgba(0,0,0,0.8);
left: 10%;
border-radius:10px;
}
.closegonggao{
    position: absolute;
    right: 10px;
    height: 40px;
    width: 40px;
    top: 10px;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<form class="well form-search" method="post" action="admin.php?g=Admin&m=Teampaisys&a=index">
                <input type="text" id="search_name" name="name" style="width:190px;" value="{$postData['name']}" placeholder="战队名称"> 
				&nbsp;&nbsp;
			<input type="submit" class="btn btn-primary" value="搜索" /> &nbsp;&nbsp;
			&nbsp;<a href="javascript:;" id="goExp" class="btn btn-primary"> 导出 </a>
			<script type="text/javascript">
		            $(function() {
		            	$("#goExp").click(function(){
		            		var _name=$("#search_name").val();
		            		window.location.href="http://climb-game.51wom.com/chuang/?c=ex-zhan&gid={$gameId}&name="+_name;
				        });
		            });
	            </script>
	            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您查看的是：
				<select name="game" id="game" style="width:280px;">
				    <foreach name="gameInfo" item="game">
				       <option value="{$game.id}" <if condition="$gameId == $game['id']">selected="selected"</if> >{$game.name}</option>
				    </foreach>
 
				 </select> 数据 
			     <script type="text/javascript">
		            $(function() {
		            	$("#game").change(function(){
		            		var _gid=$("#game").val();
		            		window.location.href="admin.php?g=Admin&m=Teampaisys&a=index&gid="+_gid;
		            	});
		            });
	            </script>
		</form>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="30">排名</th>
						<th width="90">战队名称</th>
						<th width="60">战队成员</th>
						<th width="60">战队积分</th>
						<th width="60">获奖情况</th>
						<th width="60">操作</th>
					</tr>
				</thead>
				<foreach name="thedata" item="data">
					<tr>
						<td><b>{$data['pid']}</b></td>
						<td><b>{$data['name']}</b></td>
						<td><b><a href="javascript:;" onclick="openDetail({$data['id']})">&nbsp;&nbsp; {$data['renshu']} &nbsp;&nbsp;</a></b></td>
						<td><b>{$data['fen']}</b></td>
						<td><b>
						<if condition="1 == $data['ishuojiang']">获奖</if>
						</b></td>
						<td><b><a style="color:#000000;" href="admin.php?g=Admin&m=Teampaisys&a=edit&id={$data['id']}&p={$postData['p']}">编辑</a></b></td>
					</tr>	
				</foreach>			
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	
	<div class="thepop-msg">
	    <br />
	    <p style="width:100%;height:40px;text-align:center;color:#fff;font-weight:600;font-size:16px;">战队人员</p>
	    <img src="http://climb-game.51wom.com/images/close.png" class="closegonggao">
	    <table style="width:90%;margin-left:5%;background:#fff;" class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="70">用户信息</th>
						<th width="40">手机号</th>
						<th width="30">积分</th>
					</tr>
				</thead>
			    <tbody id="showUser">
			    <!-- 
			    <tr>
			        <td><b><img width="46" src="https://thirdwx.qlogo.cn/mmopen/vi_32/iaGYjUvaxbTKbHGkW1K7WDN9lD6M7QPk604jbQC1WoANtIiam6K5D5TYWPBzhdG4ksWh5AfwibljRuEw9WVsn7gFA/132"> 狂吻鱼</b></td>
					<td><b>13625412331</b></td>
					<td><b>200</b></td>
				</tr>
			     -->
		      </tbody>
		</table>
	    
	</div>
	
	<script src="public/js/common.js"></script>
	<script type="text/javascript">
		function openDetail(id){
			
			$.post("admin.php?g=Admin&m=Teampaisys&a=theget", {id:id}, function(data){
				$(".thepop-msg").show();
				var _html='';
				if(typeof(data.u) != 'undefined'){
					for(var i=0;i<data.u.length;i++){
						_html+='<tr><td><b><img width="46" src="'+data.u[i].headimg+'"> '+data.u[i].name+'</b></td>';
						_html+='<td><b>'+data.u[i].phone+'</b></td><td><b>'+data.u[i].fen+'</b></td></tr>';
					}
					
				}
				$("#showUser").html(_html);
				console.log(data)
			}, "json");
		}
		$(".closegonggao").click(function(){
			$(".thepop-msg").hide();
		});
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				
			});
		});
	</script>
</body>
</html>